<template>
  <div>
    <h1>{{count}}</h1>
    <button @click="ADD">+</button>
    <button @click="REDUCE">-</button>
  </div>
</template>

<script>
import {mapState,mapActions,mapGetters,mapMutations} from 'vuex';
  export default {
    data () {
      return {
        // count:4
      }
    },
    methods: {
      ...mapActions(['ADD']),
      ...mapActions(['REDUCE'])
    },
    computed: {
          ...mapState(['count']),
        //  ...mapGetters(['count']),   //相当于this.$store.state.count，将count传递给vuex中的state
    },
  }
</script>

<style lang='scss' scoped=''>

</style>